<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="校区" prop="deptId">
          <treeselect style="width:200px" v-model="queryParams.deptId" :options="campusOptions" 
                :multiple="false" :disableBranchNodes="true"
                :show-count="true" placeholder="请选择归属校区" />
      </el-form-item>
      <el-form-item label="城市" prop="cityId">
        <treeselect style="width:200px" v-model="queryParams.cityId" :options="cityOptions" 
                :multiple="false"
                :show-count="true" placeholder="请选择归属城市" />
      </el-form-item>
      <el-form-item label="学校名称" prop="schoolName">
        <el-input
          v-model="queryParams.schoolName"
          placeholder="请输入学校名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['edu:hSchools:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['edu:hSchools:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['edu:hSchools:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['edu:hSchools:export']"
        >导出</el-button>
      </el-col>
	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="hSchoolsList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <!--<el-table-column label="院校ID" align="center" prop="schoolId" />-->
      <el-table-column label="校区" align="center" prop="deptName" />
      <el-table-column label="学校编码" align="center" prop="schoolCode" />
      <el-table-column label="学校名称" align="center" prop="schoolName" />
      <el-table-column label="城市" align="center" prop="provinceName" />
      <el-table-column label="状态" :formatter="statusFormat" align="center" prop="status" />
      <el-table-column label="排序" align="center" prop="sort" />
      <!--
      <el-table-column label="备注" align="center" prop="remark" />
      -->
      <el-table-column label="操作" align="center" min-width="150px" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['edu:hSchools:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleQryCollege(scope.row)"
            v-hasPermi="['edu:hSchools:edit']"
          >学院专业</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleQryCounterpartsSchool(scope.row)"
            v-hasPermi="['edu:hSchools:edit']"
          >对口高校</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['edu:hSchools:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改高职院校信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-tabs v-model="activeName" @tab-click="handleTabChange">
          <el-tab-pane label="基本信息" name="first">
            <el-form-item label="校区" prop="deptId">
              <treeselect style="width:200px" v-model="form.deptId" :options="campusOptions" 
                :multiple="false" :disableBranchNodes="true"
                :show-count="true" placeholder="请选择归属校区" />
            </el-form-item>
            <el-form-item label="学校编码" prop="schoolCode">
              <el-input v-model="form.schoolCode" placeholder="请输入学校代码" />
            </el-form-item>
            <el-form-item label="学校名称" prop="schoolName">
              <el-input v-model="form.schoolName" placeholder="请输入学校名称" />
            </el-form-item>
            <el-form-item label="城市" prop="cityId">
              <treeselect style="width:200px" v-model="form.cityId" :options="cityOptions" 
                :multiple="false"
                :show-count="true" placeholder="请选择归属城市" />
            </el-form-item>
            <el-form-item label="排序" prop="sort">
              <el-input v-model="form.sort" placeholder="请输入排序" />
            </el-form-item>
            <el-form-item label="状态">
              <el-radio-group v-model="form.status">
                    <el-radio
                      v-for="dict in statusOptions"
                      :key="dict.dictValue"
                      :label="dict.dictValue"
                    >{{dict.dictLabel}}</el-radio>
                  </el-radio-group>
            </el-form-item>
          </el-tab-pane>
          <el-tab-pane label="学院专业" name="second">
            <el-row>
              <el-col :span="12">
                <el-button size="mini" type="primary"
                  icon="el-icon-plus" @click="addCollege()">新增学院</el-button>
                <div style="margin: 15px 0;"></div>
                <el-row  style="margin-left: -115px;" v-for="(item,index) in collegeList" :key="index">
                 <el-col :span="4">
                   <el-form-item label=""  >
                    <el-input v-model="item.collegeCode" style="width:100px" placeholder="学院编码" />
                  </el-form-item>
                 </el-col>
                 <el-col :span="4">
                   <el-form-item label="" >
                    <el-input v-model="item.collegeName" style="width:100px" placeholder="学院名称" />
                  </el-form-item>
                 </el-col>
                 <el-col :span="3">
                    <el-form-item label="" prop="sort">
                      <el-input v-model="item.sort" style="width:80px" placeholder="排序" />
                    </el-form-item>
                  </el-col>
                 <el-col :span="3">
                   <el-form-item label="" >
                    <el-select v-model="item.status" style="width:80px" placeholder="状态">
                      <el-option
                          v-for="dict in statusOptions"
                          :key="dict.dictValue"
                          :label="dict.dictLabel"
                          :value="dict.dictValue"
                        />
                    </el-select>
                  </el-form-item>
                 </el-col>
                 <el-col :span="10">
                   <div style="text-align:right;" v-if="collegeList.length > 1" >
                     <el-button size="mini" type="primary"
                      icon="el-icon-edit"
                      @click="showMajor(index)">专业</el-button>
                    <el-button size="mini" type="danger"
                      icon="el-icon-delete"
                      @click="delCollege(index)">删除</el-button>
                   </div>
                 </el-col>
                </el-row>
              </el-col>
              <el-col :span="12">
                <div v-if="majorEditFlag">
                  <el-button size="mini" type="primary"
                    icon="el-icon-plus" @click="addMajor()">新增专业</el-button>
                  <div style="margin: 15px 0;"></div>
                  <el-row  style="margin-left: -115px;" v-for="(item,index) in majorList" :key="index">
                    <el-col :span="5">
                      <el-form-item label="">
                        <el-input v-model="item.majorCode" style="width:140px" placeholder="专业编码" />
                      </el-form-item>
                    </el-col>
                    <el-col :span="5">
                      <el-form-item label="" >
                        <el-input v-model="item.majorName" style="width:140px" placeholder="专业名称" />
                      </el-form-item>
                    </el-col>
                     <el-col :span="3">
                        <el-form-item label="" prop="sort">
                          <el-input v-model="item.sort" style="width:80px" placeholder="排序" />
                        </el-form-item>
                      </el-col>
                    <el-col :span="3">
                      <el-form-item label="">
                        <el-select v-model="item.status" style="width:80px" placeholder="状态">
                          <el-option
                              v-for="dict in statusOptions"
                              :key="dict.dictValue"
                              :label="dict.dictLabel"
                              :value="dict.dictValue"
                            />
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="8">
                      <div style="text-align:right;">
                        <el-button size="mini" type="danger"
                          icon="el-icon-delete" v-if="majorList.length > 1" 
                          @click="delMajor(index)">删除</el-button>
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </el-col>
            </el-row>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" type="primary" @click="submitForm">确 定</el-button>
        <el-button size="mini" @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="title" :visible.sync="openCounterpartSchool" width="1200px" style="height:500px" append-to-body>
      <el-form ref="counterpartForm" label-width="120px">
        <el-row>
            <el-col :span="9">
              <el-button size="mini" type="primary"
                icon="el-icon-plus" @click="addBSchool()">新增对口高校</el-button>
              <div style="margin: 15px 0;"></div>
              <el-row  style="margin-left: -115px;" v-for="(item,index) in bSchoolList" :key="index">
               <el-col :span="12">
                 <el-form-item label=""  >
                  <el-select v-model="item.bSchoolId" style="width:190px" placeholder="本科学校">
                    <el-option
                        v-for="school in bSchoolOptions"
                        :key="school.schoolId"
                        :label="school.schoolName"
                        :value="school.schoolId"
                      />
                  </el-select>
                </el-form-item>
               </el-col>
               <el-col :span="12">
                 <div style="text-align:center;" v-if="bSchoolList.length > 1" >
                   <el-button size="mini" type="primary"
                    icon="el-icon-edit"
                    @click="showBMajor(item, index)">对口专业</el-button>
                  <el-button size="mini" type="danger"
                    icon="el-icon-delete"
                    @click="delBSchool(index)">删除</el-button>
                 </div>
               </el-col>
              </el-row>
            </el-col>
            <el-col :span="15">
              <div v-if="bMajorEditFlag">
                <el-button size="mini" type="primary"
                  icon="el-icon-plus" @click="addBMajor()">新增对口专业</el-button>
                <div style="margin: 15px 0;"></div>
                <el-row  style="margin-left: -115px;" v-for="(item,index) in bMajorList" :key="index">
                  <el-col :span="8">
                    <el-form-item label="" >
                      <treeselect v-model="item.hMajorId" :options="hSchoolTreeList" 
                        :multiple="false" :disableBranchNodes="true"
                        style="width: 200px"
                        :show-count="true" placeholder="请选择高职专业" />
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="" >
                      <treeselect v-model="item.bMajorId" :options="bSchoolTreeList" 
                        :multiple="false" :disableBranchNodes="true"
                        style="width: 200px"
                        :show-count="true" placeholder="请选择本科专业" />
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <div style="text-align:right;">
                      <el-button size="mini" type="danger"
                        icon="el-icon-delete"
                        @click="delBMajor(index)">删除</el-button>
                      <!--<el-button size="mini" type="danger"
                        icon="el-icon-delete" v-if="bMajorList.length > 1" 
                        @click="delBMajor(index)">删除</el-button>-->
                    </div>
                  </el-col>
                </el-row>
              </div>
            </el-col>
          </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" type="primary" @click="submitHBForm">确 定</el-button>
        <el-button size="mini" @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listHSchools, getHSchools, getHSchoolTree, getBSchoolTree, updateHBSchools, delHSchools, addHSchools, updateHSchools, exportHSchools } from "@/api/edu/hSchools";
import { listSchool } from "@/api/edu/bSchools";
import { treeselectByType } from "@/api/system/dept";
import { provinceTreeselect } from "@/api/edu/province";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "HSchools",
  components: { Treeselect },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 高职院校信息表格数据
      hSchoolsList: [],
      campusOptions: [],
      cityOptions: [],
      statusOptions: [],
      // 弹出层标题
      title: "",
      activeName: 'first',
      collegeList: [{
        collegeCode: null,
        collegeName: null,
        sort: null,
        status: null,
        majorList: null
      }],
      majorList: null/*[{
        majorCode: null,
        majorName: null,
        status: null
      }]*/,
      majorEditFlag: false,
      currentCollegeIndex: null,
      // 对口高校
      bSchoolList: [{
        bSchoolId: null,
        bMajorList: null
      }],
      bMajorList: null,
      // 是否显示弹出层
      open: false,
      counterpartSchoolOptions: [],
      openCounterpartSchool: false,
      bSchoolOptions: [],
      hSchoolTreeList: [],
      bSchoolTreeList: [],
      bMajorEditFlag: false,
      currentBMajorIndex: null,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deptId: null,
        schoolCode: null,
        schoolName: null,
        cityId: null,
        status: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        deptId: [
          { required: true, message: "校区ID不能为空", trigger: "blur" }
        ],
        schoolCode: [
          { required: true, message: "学校代码不能为空", trigger: "blur" }
        ],
        schoolName: [
          { required: true, message: "学校名称不能为空", trigger: "blur" }
        ],
        cityId: [
          { required: true, message: "城市ID不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    
    this.queryCampus();
    this.treeListProvince()
    this.getDicts("sys_normal_disable").then(response => {
      this.statusOptions = response.data;
    });
    this.queryBSchool()
    this.getList();
  },
  methods: {
    queryCampus() {
      // 查询校区（deptType = 1）
      treeselectByType("1").then(response => {
        this.campusOptions = response.data;
      })
    },
    treeListProvince() {
      provinceTreeselect().then(response => {
        this.cityOptions = response.data;
        //const data = { provinceId: 0, provinceName: '顶级节点', children: [] };
        //data.children = this.handleTree(response.data, "provinceId", "parentId");
        //this.cityOptions.push(data);
      });
    },
    // 状态字典翻译
    statusFormat(row, column) {
      return this.selectDictLabel(this.statusOptions, row.status);
    },
    queryBSchool() {
      listSchool().then(response => {
        this.bSchoolOptions = response.data
      })
    },
    /** 查询高职院校信息列表 */
    getList() {
      //console.log(JSON.stringify(this.queryParams))
      this.loading = true;
      listHSchools(this.queryParams).then(response => {
        this.hSchoolsList = response.rows;
        //console.log(JSON.stringify(this.hSchoolsList))
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.openCounterpartSchool = false;
      this.reset();
    },
    // 切换tabs
    handleTabChange(tab, event) {
      if("second" === this.activeName) {
        //console.log(JSON.stringify(this.form.eduModelAttrList))
        if(this.form.eduHCollegesList.length > 0) {
          this.collegeList = [] //.splice(0,1) // 删除原来的空行
          this.form.eduHCollegesList.forEach(college => {
            this.collegeList.push({
              collegeCode: college.collegeCode,
              collegeName: college.collegeName,
              sort: college.sort,
              status: college.status,
              majorList: college.eduHMajorsList
            })
          })
        }
      } else {
        if(this.collegeList.length > 0) {
          // 其它情况需要临时保存已编辑为保存的属性
          this.form.eduHCollegesList = []
          this.collegeList.forEach(college =>{
            this.form.eduHCollegesList.push({
              collegeCode: college.collegeCode,
              collegeName: college.collegeName,
              sort: college.sort,
              status: college.status,
              eduHMajorsList: college.majorList
            })

          })
        }
        
      }
    },
    // 表单重置
    reset() {
      this.collegeList = [{
        collegeCode: null,
        collegeName: null,
        sort: null,
        status: null,
        majorList: null
      }]
      this.majorList = null/*[{
        majorCode: null,
        majorName: null,
        status: null
      }]*/

      this.bSchoolList = [{
        bSchoolId: null,
        bMajorList: null
      }]
      this.bMajorList = null

      this.form = {
        schoolId: null,
        deptId: null,
        deptName: null,
        schoolCode: null,
        schoolName: null,
        cityId: null,
        provinceName: null,
        sort: null,
        status: "0",
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        eduHCollegesList: null,
        eduHBSchoolList: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.schoolId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加高职院校信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const schoolId = row.schoolId || this.ids
      getHSchools(schoolId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改高职院校信息";

        if(this.form.eduHCollegesList.length > 0) {
          this.collegeList = [] //.splice(0,1) // 删除原来的空行
          this.form.eduHCollegesList.forEach(college => {
            this.collegeList.push({
              collegeCode: college.collegeCode,
              collegeName: college.collegeName,
              sort: college.sort,
              status: college.status,
              majorList: college.eduHMajorsList
            })
          })
        }
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.eduHCollegesList = []
          this.collegeList.forEach(college =>{
            if(college.collegeName) {
              this.form.eduHCollegesList.push({
                collegeCode: college.collegeCode,
                collegeName: college.collegeName,
                sort: college.sort,
                status: college.status,
                eduHMajorsList: college.majorList
              })
            }
            
          })

          if (this.form.schoolId != null) {
            updateHSchools(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addHSchools(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const schoolIds = row.schoolId || this.ids;
      this.$confirm('是否确认删除高职院校信息编号为"' + schoolIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delHSchools(schoolIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有高职院校信息数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportHSchools(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    },
    addCollege() {
      //console.log(this.classSubjects.length)
      this.collegeList.push({
        collegeCode: null,
        collegeName: null,
        sort: null,
        status: null,
        })
    },
    showMajor(index) {
      this.majorEditFlag = true
      // 切换学院，将编辑中专业保存到对应学院list
      if(this.currentCollegeIndex !== null) {
        this.collegeList[this.currentCollegeIndex].majorList = this.majorList
      }
      this.majorList = this.collegeList[index].majorList
      this.currentCollegeIndex = index
    },
    delCollege(index) {
      if(this.collegeList.length > 1) {
        this.collegeList.splice(index,1)
      } else {
        this.msgError("至少有一个学院");
      }
    },
    addMajor() {
      //console.log(JSON.stringify(this.majorList))
      if(!this.majorList || null === this.majorList) {
        this.majorList = [{
        majorCode: null,
        majorName: null,
        sort: null,
        status: null,
        }]
      } else {
        this.majorList.push({
        majorCode: null,
        majorName: null,
        sort: null,
        status: null,
        })
      }
    },
    delMajor(index) {
      if(this.majorList.length > 1) {
        this.majorList.splice(index,1)
      } else {
        this.msgError("至少有一个专业");
      }
    },
    handleQryCollege(row) {
      this.reset();
      const schoolId = row.schoolId || this.ids
      getHSchools(schoolId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改高职院校信息";
        this.activeName = "second"
        this.handleTabChange()
      })
    },
    // 对口本科院校功能
    handleQryCounterpartsSchool(row) {
      this.reset()
      const hSchoolId = row.schoolId || this.ids
      getHSchools(hSchoolId).then(response => {
        this.form = response.data;
        this.openCounterpartSchool = true;
        this.title = "对口高校";

        if(this.form.eduHBSchoolList.length > 0) {
          this.bSchoolList = [] //.splice(0,1) // 删除原来的空行
          this.form.eduHBSchoolList.forEach(school => {
            this.bSchoolList.push({
              bSchoolId: school.bSchoolId,
              bMajorList: school.eduHBMajorList
            })
          })
        }

        // 查询可选学校专业树结构(在编辑对口专业之前先获取了)
        getHSchoolTree(hSchoolId).then(response => {
          this.hSchoolTreeList = response.data;
          //console.log(JSON.stringify(this.hSchoolTreeList))
        })
      })
    },
    addBSchool() {
      this.bSchoolList.push({
        bSchoolId: null,
        bMajorList: null
      })
    },
    showBMajor(item, index) {
      const schoolId = item.bSchoolId
      getBSchoolTree(schoolId).then(response => {
        this.bSchoolTreeList = response.data;
        //console.log(JSON.stringify(this.bSchoolTreeList))
      })

      this.bMajorEditFlag = true
      // 切换学校，将编辑中专业保存到对应学校list
      if(this.currentBMajorIndex !== null) {
        this.bSchoolList[this.currentBMajorIndex].bMajorList = this.bMajorList
      }
      this.bMajorList = this.bSchoolList[index].bMajorList
      this.currentBMajorIndex = index
    },
    delBSchool(index) {
      if(this.bSchoolList.length > 1) {
        this.bSchoolList.splice(index,1)
      } else {
        this.msgError("至少有一个高校");
      }
    },
    addBMajor() {
      if(!this.bMajorList || null === this.bMajorList) {
        this.bMajorList = [{
          bMajorId: null,
          hMajorId: null
        }]
      } else {
        this.bMajorList.push({
          bMajorId: null,
          hMajorId: null
        })
      }
    },
    delBMajor(index) {
      this.bMajorList.splice(index,1)
      /*
      if(this.bMajorList.length > 1) {
        this.bMajorList.splice(index,1)
      } else {
        this.msgError("至少有一个专业");
      }*/
    },
    // 提交对口学校和专业
    submitHBForm() {
      // 提交前将当前编辑对口专业转存到对口学校子集中
      this.bSchoolList[this.currentBMajorIndex].bMajorList = this.bMajorList

      this.form.eduHBSchoolList = []
          this.bSchoolList.forEach(school =>{
            this.form.eduHBSchoolList.push({
              hSchoolId: this.form.schoolId,
              bSchoolId: school.bSchoolId,
              eduHBMajorList: school.bMajorList
            })
          })
          //console.log(JSON.stringify(this.form.eduHBSchoolList))
          updateHBSchools(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.openCounterpartSchool = false
              this.getList();
            });
    },
  }
};
</script>
